package cn.itcast.scala

object CaseClass {
  case class Person(name:String,age:Int)

  def main(args: Array[String]): Unit = {
    val a = new Person("A",25)
    val b = new Person("B",32)
    val c = new Person("C",37)

    for(person <- List(a,b,c)) {
      person match {
        case Person("A",25) => println("aA")
        case Person("B",32) => println("bB")
        case Person(name,age) => println("Name: " + name + "\t" + "Age: " + age)
      }
    }
  }
}
